<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('cate_id')->comment('商品类型编号');
            $table->bigInteger('merchant_id')->comment('商户id');
            $table->string('name',250)->comment('商品名字');
            $table->text('detail')->nullable()->comment('商品详情');
            $table->decimal('price',20,2)->comment('商品价格');
            $table->integer('stock')->comment('商品库存 -1：库存足够');
            $table->tinyInteger('status')->comment('商品状态 1：在售  2：下架');
            $table->tinyInteger('activity_type')->comment("活动类型 1：普通  2：团购  3：秒杀");
            $table->tinyInteger('verify')->comment("审核状态");
            $table->tinyInteger('shelves')->comment("上下架状态");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
